package com.furongji.education.domain.po;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.furongji.common.enums.CommentStatusEnum;
import com.furongji.common.enums.CommentTargetTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 通用评论表
 * </p>
 *
 * @author furongji
 * @since 2025-06-03
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("comment")
@Schema(description = "通用评论表")
public class Comment implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "评论ID")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @Schema(description = "评论用户ID")
    private String userId;

    @Schema(description = "被评论对象ID（课程ID或文章ID）")
    private String targetId;

    @Schema(description = "被评论对象类型，course/article等")
    private CommentTargetTypeEnum targetType;

    @Schema(description = "评论内容")
    private String content;

    @Schema(description = "父评论ID，0为主评论")
    private String parentId;

    @Schema(description = "点赞数")
    private Integer likeCount;

    @Schema(description = "回复数")
    private Integer replyCount;

    @Schema(description = "状态，1正常，0删除或屏蔽")
    private CommentStatusEnum status;

    @Schema(description = "0未删除，1已删除")
    @TableLogic
    private Boolean isDeleted;

    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    @Schema(description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime gmtModified;


}
